<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
	//遍历循环左侧所有一级栏目以及下面的子栏目以及轮播图
    public function index(){
        $picture = D('picture')->field('p_img')->limit(6)->select();
        // print_r($picture);
    	$cats = D('Cat')->select();
    	// print_r($cats);
    	$cat = D('Cat')->order('cat_id')->where('parent_id = 0')->limit(10)->select();
        $this->assign('pic',$picture);
    	$this->assign('cat',$cat);
    	$this->assign('cats',$cats);
      	$this->display();
    }
}
